package com.Web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.entity.Employee;
import com.entity.employProject;
import com.service.ProjectService;
import com.service.TaskService;

public class FindTask extends HttpServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		Employee em = (Employee) session.getAttribute("em");
		String id = request.getParameter("id");
			
		
		ProjectService service = new ProjectService();

		employProject ep = service.findById(Integer.parseInt(id),em.getId());
		
		TaskService service1 = new TaskService();
		
		List<com.entity.Task> taskList1 =  service1.findById(Integer.parseInt(id));
		
		
		session.setAttribute("taskList", taskList1);

		session.setAttribute("role", ep.getRoal());
		
		session.setAttribute("ep", ep);
		request.getRequestDispatcher("/WEB-INF/views/adminmain.jsp").forward(request, response);
	}

}
